Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: lint and pre-commit hook with Husky and eslint #33

Merged
merged 11 commits into from
Apr 8, 2024

Conversation

Sembauke
Copy link
Member

@Sembauke Sembauke commented Apr 8, 2024

Checklist:

Closes #XXXXX

Copy link

socket-security bot commented Apr 8, 2024

@Sembauke Sembauke force-pushed the feat/lint-and-precommit-hook branch 2 times, most recently from a33e647 to 7de03f1 Compare April 8, 2024 07:06
@Sembauke Sembauke marked this pull request as ready for review April 8, 2024 07:25
@Sembauke Sembauke requested a review from a team as a code owner April 8, 2024 07:25
@Sembauke Sembauke marked this pull request as draft April 8, 2024 07:26
@Sembauke Sembauke marked this pull request as ready for review April 8, 2024 07:51
@Sembauke Sembauke marked this pull request as draft April 8, 2024 08:03
@Sembauke Sembauke marked this pull request as ready for review April 8, 2024 08:20
Copy link
Member

@huyenltnguyen huyenltnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested the changes yet. Will pull down and test the PR a little later today 🙂

.eslintrc.json Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
Sembauke and others added 7 commits April 8, 2024 10:54
Our prop types are fine, but eslint-react isn't detecting them
correctly.

With a little help

jsx-eslint/eslint-plugin-react#3284 (comment)

we can tell it what the props are.
Same principle as the main repo: if we care enough for something to be a
rule, we want CI to tell us when it's not being followed.
@ojeytonwilliams
Copy link
Contributor

ojeytonwilliams commented Apr 8, 2024

@huyenltnguyen I had to fix a few errors, but nothing that required me to change the functionality, just types. I hope that's okay!

If I messed anything up, please let me know/push a commit.

Copy link
Contributor

@ojeytonwilliams ojeytonwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together, @Sembauke.

I made a few tweaks, so I'll explain the justification:

  • Similarly to the main repo, treat eslint warnings as errors (otherwise they're likely to be ignored)
  • Use recommended rules for all plugins. They're generally good defaults, so we should use them until we have a reason not to
  • Add eslint . to lint script. Otherwise CI will not run it.

@Sembauke Sembauke merged commit 18d207f into freeCodeCamp:main Apr 8, 2024
4 checks passed
@Sembauke Sembauke deleted the feat/lint-and-precommit-hook branch April 8, 2024 11:30
@Sembauke Sembauke mentioned this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants